package main

import (
	"fmt"
)

type Log struct {
	name string
	content string
}

type NetLog struct {
	Log
}

type FileLog struct {
	Log
}

func (this *Log) writeLog (_write Write) {
	fmt.Println(this.name  + "--------" + this.content)
	_write.out()
	_write.echo()
}

type Write interface {
	echo()
	out()
}

type IoWrite string
func (this *IoWrite) echo(){
	fmt.Println("IoWrite: echo()")
}
func (this *IoWrite) out(){
	fmt.Println("IoWrite: echo()")
}

type NetWrite string
func (this *NetWrite) echo(){
	fmt.Println("NetWrite: echo()")
}
func (this *NetWrite) out(){
	fmt.Println("NetWrite: echo()")
}

func main(){
	var log = &Log{
		"微信日志",
		"日志内容：",
	}
	var _iowrite  *IoWrite
	var _netwrite  *NetWrite
	log.writeLog(_iowrite)
	log.writeLog(_netwrite)

	netLog := &NetLog{Log{name: "微信网络日志", content: "日志内容"}}
	netLog.writeLog(_netwrite)

	ioLog := &NetLog{Log{name: "微信文件日志", content: "日志内容"}}
	ioLog.writeLog(_iowrite)
}
